public class Room {

    /**
     * (1)私有成员变量包括房间编号id，面积area，户型type，单价price（元/平米），销售状态state等；
     * (2)定义一个空构造方法；定义第二个构造方法能够根据房间编号，面积，单价创建Room对象；定义第三个构造方法能够根据所有成员变量创建Room对象；
     * (3)定义针对成员变量state和price的setter和getter方法，定义getArea()方法返回房间面积；
     * (4)功能方法包括：showRoom()方法输出Room对象所有成员变量；getMoney()获得房间总价。
     * */
    private String id;
    private double area;
    private String type;
    private boolean state;//1表示已预订，0表示未预订
    private double price;

    public void showRoom(){
        if (state)
            System.out.println("房间号："+id+" 房间面积："+area+" 房间类型："+type+" 房间状态：未预订"+" 房间价格："+price);
        else
            System.out.println("房间号："+id+" 房间面积："+area+" 房间类型："+type+" 房间状态：已预订"+" 房间价格："+price);

    }
    /**
     * 构造方法
     */
     Room(String id, double area, String type, boolean state, double price) {
        this.id = id;
        this.area = area;
        this.type = type;
        this.state = state;
        this.price = price;
    }
    Room(){
         id = "1-0-0";
         area = 1.0;
         type = "普通房";
         state = true;
         price = 100.0;
    }

    Room(String id,double area){
         this.id = id;
         this.area = area;
        type = "普通房";
        state = true;
        price = 100.0;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getArea() {
        return area;
    }

    public void setArea(double area) {
        this.area = area;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean getState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Room{" +
                "id=" + id +
                ", area=" + area +
                ", type='" + type + '\'' +
                ", state=" + state +
                ", price=" + price +
                '}';
    }
}
